<div class="boxRegister" id="formRegister" {if !isset($type)}{if isset($smarty.get.err) && $smarty.get.err > 0}style="display:block;"{else}style="display:none;"{/if}{/if}>
	{if !isset($type)}
    	<h2><a href="javascript:showLogin();" class="back">Quay về đăng nhập</a></h2>
    {else}
    	<div class="headerTitle"><h3>Đăng ký</h3></div>
    {/if}
    <div class="registerItem">
    	{if !isset($type)}<h3>Đăng ký</h3>{/if}
        <form method="post" id="frmRegister" name="frmRegister" action="{$smarty.const.HOST_VFRIEND}index/save" enctype="multipart/form-data">
        	<input type="hidden" name="ptype" id="ptype" value="{if isset($type)}{$type}{else}0{/if}"/>
            {if !$smarty.const.FUNCTION_INTVITE && (isset($intHexId) || (isset($smarty.session.uinfo.psrcid) && $smarty.session.uinfo.psrcid > 0 ))} 
            	<input type="hidden" name="psrcid" id="psrcid" value="{if isset($smarty.session.uinfo.psrcid) && $smarty.session.uinfo.psrcid > 0}{$smarty.session.uinfo.psrcid}{else}{$intHexId}{/if}" />
            {/if}
        	{if isset($smarty.get.err)}
            	<div class="userInput" id="secMessage">
                	{if isset($type) && $type == 1}
                    	<span class="errorMessage">{if $smarty.get.err==-1}Email này đã được đăng ký. Bạn vui lòng chọn địa chỉ khác.{else}{$arrError[$smarty.get.err]}{/if}</span>
                    {else}                    
	                	<div class="errorMessage">{if $smarty.get.err==-1}Email này đã được đăng ký. Bạn vui lòng chọn địa chỉ khác.{else}{$arrError[$smarty.get.err]}{/if}</div>
                   	{/if}
                </div>
           	{else}
	            <div class="userInput" id="secMessage" style="display:none;">
    	            <div class="errorMessage">&nbsp;</div>
               	</div>
            {/if}    	
            <div class="userInput">
                <label for="pfirstname">Họ:</label>
                <input type="text" id="pfirstname" name="pfirstname" class="text half" value="{if isset($smarty.session.uinfo.pfirstname)}{$smarty.session.uinfo.pfirstname|escape}{/if}"/>
                <label for="plastname" class="half">Chữ lót &amp; tên:</label>
                <input type="text" id="plastname" name="plastname" class="text half" value="{if isset($smarty.session.uinfo.plastname)}{$smarty.session.uinfo.plastname|escape}{/if}"/>
            </div>
            <div class="userInput">
                <label for="pemail" class="text">Email:</label>
                <input type="text" id="premail" name="premail" class="text" value="{if isset($smarty.session.uinfo.premail)}{$smarty.session.uinfo.premail|escape}{/if}"/>
            </div>
            <div class="userInput">
                <label for="ppassword" class="text">Mật khẩu:</label>
                <input type="password" id="prpassword" name="prpassword" class="text"/>
            </div>
            <div class="userInput">
                <label for="ppassword_confirm" class="text">Xác nhận:</label>
                <input type="password" id="ppassword_confirm" name="ppassword_confirm" class="text"/>
            </div>
            <div class="userInput">
                <label for="pgender" class="text">Giới tính:</label>  
                <div class="gender">
                    <select id="pgender" name="pgender" class="select" title="Chọn">
                        <option value="">Chọn</option>
                        {if isset($smarty.session.uinfo.pgender)}
                            {html_options options=$arrGender selected=$smarty.session.uinfo.pgender}
                        {else}
                            {html_options options=$arrGender}
                        {/if}
                    </select>
              	</div> 
            </div>
            
            <div class="userInput">
                <label for="pday" class="text">Ngày sinh:</label>
                <div class="day">
                    <select id="pday" name="pday" class="select" title="Ngày">
                        <option value="">Ngày</option>
                        {if isset($smarty.session.uinfo.pday)}
                            {html_options options=$arrDay selected=$smarty.session.uinfo.pday}
                        {else}
                            {html_options options=$arrDay}
                        {/if}
                    </select>  
                </div>
                <div class="month">
                    <select id="pmonth" name="pmonth" class="select" title="Tháng">
                        <option value="">Tháng</option>
                        {if isset($smarty.session.uinfo.pmonth)}
                            {html_options options=$arrMonth selected=$smarty.session.uinfo.pmonth}
                        {else}
                            {html_options options=$arrMonth}
                        {/if}
                    </select>   
                </div>
                <div class="year">
                    <select id="pyear" name="pyear" class="select" title="Năm">
                        <option value="">Năm</option>
                        {if $smarty.session.uinfo.pyear}
                            {html_options options=$arrYear selected=$smarty.session.uinfo.pyear}
                        {else}
                            {html_options options=$arrYear}
                        {/if}
                    </select>
                </div>
                
                         
                       
            </div>   
          	{if $smarty.const.FUNCTION_INTVITE}               
            	<div class="userInput">
                    <label for="psrcid" class="text">Mã thư mời:</label>
                    <input type="text" id="psrcid" name="psrcid" value="{if isset($smarty.session.uinfo.psrcid) && $smarty.session.uinfo.psrcid > 0}{$smarty.session.uinfo.psrcid}{else}{$intHexId}{/if}" maxlength="25" class="text half" />
                </div>
            {else}
            	<div class="userInput">
                    <label for="pcaptcha" class="text">Mã an ninh:</label>
                    <input type="text" id="pcaptcha" name="pcaptcha" class="text half" />                    
                </div>
                <div class="userInput">
                    <div class="imgCaptcha" id="imgCaptcha">
                        {captcha}
                    </div>
                    <div class="imgRefresh"><a href="javascript:refreshCaptcha('imgCaptcha');"><img src="{$smarty.const.HOST_STATICS}img/btn/refresh.png" width="29" height="23" alt="" border="0"  /></a></div>
                </div>
            {/if}
            <div class="userInput hasLine">   
            	<label class="tos">
                	<input type="checkbox" class="chk" id="ptos" name="ptos" />
                    Tôi đồng ý với <a href="{$smarty.const.LINK_CONTENT_TOS}"><strong>điều khoản sử dụng</strong></a>
                </label>            
                <input type="image" src="{$smarty.const.HOST_STATICS}img/btn/register.gif" class="rFloat"/>
            </div>
        </form>
    </div>
</div>